﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using VideoStream.Common;

namespace VideoStream.Windows
{
    public partial class Windows_Setting : VideoStream.Windows.WindowsBase
    {
        public Windows_Setting()
        {
            InitializeComponent();
            InitUI();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            InitEvent();
            UpdateUI();
        }
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            Windows_Main.Instance.ShowMask(false);
        }
        public override void InitUI()
        {
            base.InitUI();
            this.Dock = DockStyle.Fill;
        }
        public override void InitEvent()
        {
            base.InitEvent();

            btn_Update.Click += Btn_Update_Click; ;

            cb_AutoStartup.CheckedChanged += Cb_AutoStartup_CheckedChanged;
        }


        public override void UpdateUI()
        {
            base.UpdateUI();
        }


        private void Btn_Update_Click(object sender, EventArgs e)
        {
            CommonFun.UpdateCheck(false);
        }

        private void Cb_AutoStartup_CheckedChanged(object sender, EventArgs e)
        {
            CommonFun.SetAutoRun(cb_AutoStartup.Checked);
        }
    }
}
